package site.yunnong.atvris.portal.controller;

import io.swagger.annotations.ApiModelProperty;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import site.yunnong.atvris.common.api.Page;
import site.yunnong.atvris.common.api.ResultVO;
import site.yunnong.atvris.common.dto.ReplyParam;
import site.yunnong.atvris.common.dto.ReplyQueryParam;
import site.yunnong.atvris.common.dto.ReplyUpdateParam;
import site.yunnong.atvris.portal.service.ReplyService;
import site.yunnong.atvris.service.vo.ReplyVO;

import javax.annotation.Resource;


/**
 * 动态回复
 *
 * @author zhangjinghao
 * @email jhzhang9102@163.com
 * @date 2021-07-09 23:45:37
 */
@RestController
@RequestMapping("/reply")
public class ReplyController {

    @Resource
    private ReplyService replyService;

    /**
     * 列表
     */
    @ApiModelProperty("分页查询回复列表")
    @PostMapping("/list")
    public ResultVO list(@RequestBody ReplyQueryParam param){
        Page<ReplyVO> result = replyService.queryPage(param);
        return new ResultVO().success(result);
    }

    /**
     * 保存
     */
    @ApiModelProperty("回复")
    @PostMapping("/save")
    public ResultVO save(@RequestBody ReplyParam param){
        ReplyVO vo = replyService.save(param);
        return new ResultVO().success(vo);
    }

    /**
     * 修改
     */
    @PostMapping("/update")
    public ResultVO update(@RequestBody ReplyUpdateParam param){
		replyService.update(param);
        return new ResultVO().success();
    }

}
